package com.kiko.education.model;

import java.text.SimpleDateFormat;
import java.util.Date;

public class User {
    private int ID;
    private String userID;
    private String userName;
    private String userPassword;
    private String sex;
    private Date birthday;
    private String phoneNumber;
    private int collegeID;
    private Date createDate;


    // Getters
    public int getID() {
        return ID;
    }

    public String getUserID() {
        return userID;
    }

    public String getUserName() {
        return userName;
    }

    public String getUserPassword() {
        return userPassword;
    }

    public String getSex() {
        return sex;
    }

    public Date getBirthday() {
        return birthday;
    }

    public String getPhoneNumber() {
        return phoneNumber;
    }

    public int getCollegeID() {
        return collegeID;
    }

    public Date getCreateDate() {
        return createDate;
    }

    // Setters
    public void setID(int ID) {
        this.ID = ID;
    }

    public void setUserID(String userID) {
        this.userID = userID;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public void setUserPassword(String userPassword) {
        this.userPassword = userPassword;
    }

    public void setSex(String sex) {
        this.sex = sex;
    }

    public void setBirthday(Date birthday) {
        this.birthday = birthday;
    }

    public void setPhoneNumber(String phoneNumber) {
        this.phoneNumber = phoneNumber;
    }

    public void setCollegeID(int collegeID) {
        this.collegeID = collegeID;
    }

    public void setCreateDate(Date createDate) {
        this.createDate = createDate;
    }

    // toString method
    public String toString() {
        SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");

        return "User{" +
                "ID=" + ID +
                ", userID='" + userID + '\'' +
                ", userName='" + userName + '\'' +
                ", userPassword='" + userPassword + '\'' +
                ", sex='" + sex + '\'' +
                ", birthday=" + (birthday != null ? dateFormat.format(birthday) : null) +
                ", phoneNumber='" + phoneNumber + '\'' +
                ", collegeID=" + collegeID +
                ", createDate=" + (createDate != null ? dateFormat.format(createDate) : null) +
                '}';
    }
}
